package cn.stylefeng.guns.util;

import cn.stylefeng.roses.kernel.config.api.context.ConfigContext;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class ConfigUtil {

    /**
     * 获取我的配置
     */
    public static List<String> getMailTo() {
        String sysConfigValueWithDefault = ConfigContext.me().getSysConfigValueWithDefault("report.mail.to", String.class, "");
        return Arrays.stream(sysConfigValueWithDefault.split(",")).collect(Collectors.toList());
    }

    /**
     * 获取我的配置
     */
    public static String getFileAddress() {
        String sysConfigValueWithDefault = ConfigContext.me().getSysConfigValueWithDefault("template.file.address", String.class, "");
        return sysConfigValueWithDefault;
    }
}
